package me.zk.practice1.list;

/**
 * @Author: zhang kai
 * @Date: 2021/12/30
 * @Description:
 */
public class Solution {
    public static void rotate(int[] nums, int k) {
        int len = nums.length;
        int[] temp = new int[len];
        for (int i = 0; i < len; i++) {
            temp[(i+k)%len] =nums[i];
        }
        System.arraycopy(temp,0,nums,0,len);
    }

    public static void main(String[] args) {
        rotate(new int[]{-1,-100,3,99},2);
    }


}
